package com.example.demo.judge.entity;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.stereotype.Component;

@Component
public class RequestHelper {


    public static String GET_LANGUAGES = JudgeConfigHelper.SERVER_PATH + "/languages/all";
    public static String POST_SUBMISSIONS = JudgeConfigHelper.SERVER_PATH + "/submissions/?base64_encoded=false&wait=true";

    public static HttpEntity<Object> getHttpEntity(Object object) {
        HttpHeaders headers = new HttpHeaders();
        headers.add(JudgeConfigHelper.AUTH_USER_KEY, JudgeConfigHelper.AUTH_TOKEN_VALUE);
        headers.add(JudgeConfigHelper.AUTH_USER_KEY, JudgeConfigHelper.AUTH_USER_VALUE);
        HttpEntity<Object> httpEntity = new HttpEntity<>(object,headers);
        return httpEntity;
    }
}
